import request from '@/utils/request'

// 查询优惠券列表
export function listSale(query) {
  return request({
    url: '/sale/sale/list',
    method: 'get',
    params: query
  })
}

// 删除优惠券
export function delSale(saleId) {
  return request({
    url: '/sale/sale/' + saleId,
    method: 'delete'
  })
}
// 新增优惠券
export function addSale(data) {
  return request({
    url: '/sale/sale',
    method: 'post',
    data: data
  })
}
// 复制优惠券
export function copySale(saleId) {
  return request({
    url: '/sale/sale/' + saleId,
    method: 'post'
  })
}
// 查询角色详细
export function getSale(saleId) {
  return request({
    url: '/sale/sale/' + saleId,
    method: 'get'
  })
}
// 修改优惠券
export function updateSale(data) {
  return request({
    url: '/sale/sale',
    method: 'put',
    data: data
  })
}
